<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta charset="utf-8">
    <title>Directions service</title>

    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<script>
    var WAREHOUSES={
          Stockton:"41.85,-87.65",
          Milpitas:"41.86,-87.65",
          Maywood:"41.87,-87.65",
          Corporate:"41.88,-87.65"
    };
</script>
<body>
<form action="{{:url('/importdriver')}}" enctype="multipart/form-data" method="post">
    <select name="warehouse" id="warehouse">
        <option value="Stockton">Stockton</option>
        <option value="Milpitas">Milpitas</option>
        <option value="Maywood">Maywood </option>
        <option value="Corporate">Corporate</option>
    </select>
    <input type="hidden" name="lat" value="41.85">
    <input type="hidden" name="lng" value="-87.85">
    <input type="file" name="router" /> <br>
    <input type="submit" value="上传" />
</form>

<script>

    $('#warehouse').change(function () {
           var wareHouse = $(this).val();
           var position =  WAREHOUSES[wareHouse];
           var positionArr = position.split(',');
           $('input[name=lat]').val(positionArr[0]);
           $('input[name=lng]').val(positionArr[1]);
    });
</script>
</body>
</html>